package com.xkdx.guangguang.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class AttentionSQLiteHelper extends SQLiteOpenHelper {
	private String TABNAME = "attention";
	private String SHOPID = "shopID";
	private String BRANDID = "brandID";
	private String SHOPURL = "shopUrl";
	private String BRANDURL = "brandUrl";
	private String SHOPNAME = "shopName";
	private String BRANDNAME = "brandName";
	private String SHOPTYPE = "shopType";
	private String TAG = "tag";

	public AttentionSQLiteHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE IF NOT EXISTS " + TABNAME + "(" + SHOPID + " varchar primary key," + BRANDID
				+ " varchar," + SHOPURL + " varchar," + BRANDURL + " varchar," + SHOPNAME + " varchar," + TAG
				+ " varchar," + BRANDNAME + " varchar," + SHOPTYPE + " varchar)");

	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS " + TABNAME);
		onCreate(db);

	}

}
